(function() {
    'use strict';

    angular
        .module('zhserverApp')
        .controller('AlgorithmController', AlgorithmController);

    AlgorithmController.$inject = ['$scope', '$state', 'Algorithm'];

    function AlgorithmController ($scope, $state, Algorithm) {
        var vm = this;

        vm.algorithms = [];

        loadAll();

        function loadAll() {
            Algorithm.query(function(result) {
                vm.algorithms = result;
                vm.searchQuery = null;
            });
        }
    }
})();
